﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using A2DFramework.EsbService.DistributedEsb;
using System.Threading;
using System.ServiceModel;
using A2DFramework.ServiceLocatorService.Configuration;

namespace A2DFramework.ESBServerConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            //monitor queue
            CommandHandlerListener listener = new CommandHandlerListener();
            listener.AddHandler(new EsbRequestsHandler());
            listener.Start();

            reCheckUserInput:
            string userInput=Console.ReadLine();
            if (userInput.Equals("exit", StringComparison.OrdinalIgnoreCase)
                ||
                userInput.Equals("quit", StringComparison.OrdinalIgnoreCase))
                return;

            if (userInput.Equals("reloadservice", StringComparison.OrdinalIgnoreCase))
            {
                LocatorServiceConfiguration.ReLoad();
                goto reCheckUserInput;
            }

            goto reCheckUserInput;
        }
    }
}
